package pers.email;

import pers.email.config.EmailConfig;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 *
 */
public class PopupAuthenticator extends Authenticator {

    private EmailConfig mailConfig;

    public PopupAuthenticator(EmailConfig mailConfig){
        this.mailConfig = mailConfig;
    }

    @Override
    public PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(mailConfig.getMailUser(), mailConfig.getMailPassword());
    }

}
